package com.daxiong.pattern.singleton;

/**
 * 饿汉式单例模式
 *
 * @author sunyanxiong
 * @date 2017/4/23
 */
public class SingletonEager {

    // 静态私有变量，类加载时初始化
    private static SingletonEager singleEager = new SingletonEager();

    // 私有构造函数，保证外部不能通过构造方式创建任意多个实例
    private SingletonEager(){

    }

    public static SingletonEager getSingleEager(){
        return singleEager;
    }

}
